import { ref } from 'vue'
import { defineStore } from 'pinia'

export interface Assignment {
  id: number
  title: string
  description: string
  difficulty: 'easy' | 'medium' | 'hard'
  estimatedTime: string
}

export const useAssignmentStore = defineStore('assignment', () => {
  const currentAssignment = ref<Assignment | null>(null)

  function setCurrentAssignment(assignment: Assignment) {
    currentAssignment.value = assignment
  }

  function clearCurrentAssignment() {
    currentAssignment.value = null
  }

  return {
    currentAssignment,
    setCurrentAssignment,
    clearCurrentAssignment
  }
})